package com.stu.management.controller;


import com.stu.management.pojo.Grade;
import com.stu.management.service.GradeService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@Controller
public class GradeController {
    @Resource(name = "gradeServiceImpl")
    GradeService service;

    @RequestMapping("/student/getGradeList.do")
    public void getGradeList(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {
        //查询年级列表的方法
        List<Grade> list = service.getList();
        req.setAttribute("glist",list);
        req.getRequestDispatcher("add.jsp").forward(req,resp);
    }


}
